<@t.plat_body pageid="contexts">


<script type="text/javascript" src="${base}/js/plugins/datatables/datatables.min.js"></script>
<script type="text/javascript" src="${base}/js/plugins/datatables/datatables_basic.js"></script>
<style>
    .datatable-header, .datatable-footer{
        padding-top: 0;
    }
    .table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td{
        padding: 6px;
    }
    .btn-xs, .btn-group-xs>.btn{
        padding: 1px 10px;
    }
</style>
<div class="panel panel-flat">
    <div class="panel-heading">
        <h5 class="panel-title">接入系统</h5>
        <div class="heading-elements">
            <#--<button type="button" class="btn btn-primary" onclick="dialogBox('${base}/plat/platform/editContextInfo', '添加系统', 500, 400);"><i class="icon-add position-left"></i>添加</button>-->
        </div>
    </div>

    <table class="table table-striped table-bordered datatable-basic" id="userTable">
    </table>
</div>
<script>
    function delRec(id) {
        createConfirm('您确定要删除该数据',function() {
            post('pl/platform/delContextInfo/'+id,function (result) {
                if(result.code==0){
                    table.ajax.reload();
                }else{
                    alertError(result.message);
                }
            });
        });
    }
    var table;
    $(function () {
        table=simpleTable('userTable', [
            {
                sWidth:80,
                dataIndex: 'code',
                title: "系统编号"
            },
            {

                dataIndex: 'name',
                title: "系统名称"
            },
            {
                dataIndex: 'merchant',
                title: "接入商户"
            },
            {
                sWidth:80,
                dataIndex: 'flag',
                title: "是否启用",
                render:function (data) {
                    return (data=='0')?"否":"是";
                }
            },
                {
                    sWidth:140,
                dataIndex: 'startdate',
                title: "支付起始时间(每天)"
            },{
                sWidth:140,
                dataIndex: 'enddate',
                title: "支付结束时间(每天)"
            },{
                sWidth:120,
                dataIndex: 'moneylimit',
                title: "支付单笔限额"
            },
            {
                sWidth:200,
                title: "操作",
                dataIndex: 'code',
                sClass:'text-center',
                render: function (data, type, full) {
                    if(full.sys=='1'){
                        var html = '<div>' +
                                '<a onclick="dialogBox(\'${base}/plat/platform/editContext?code='+data+'\', \'设置\', 600, 550);" class="btn btn-primary btn-xs btn-outline">设置</a>' +
                                <#--(function () {-->
                                    <#--if(full.syncflag=='1'){-->
                                        <#--return '<a style="margin-left:4px" onclick="dialogBox(\'${base}/plat/platform/editContextSync?code='+data+'\', \'设置\', 400, 250);" class="btn btn-success btn-xs btn-outline">人员同步</a>';-->
                                    <#--}-->
                                    <#--return '';-->
                                <#--})()+-->
                                '</div>';
                        return html;
                    }
                    var html = '<ul class="icons-list">'+
                            '<li class="dropdown">'+
                            '<a href="#" class="dropdown-toggle" data-toggle="dropdown">'+
                            '<i class="icon-menu9"></i>'+
                            '</a>'+
                            '<ul class="dropdown-menu dropdown-menu-right">'+
                            '<li><a href="javascript:void(0)" onclick="dialogBox(\'${base}/plat/platform/editContextInfo?code='+data+'\', \'编辑系统\', 500, 400);"><i class="icon-database-edit2"></i>编辑</a></li>'+
                            '<li><a href="javascript:void(0)" onclick="delRec(\''+data+'\')"><i class="icon-database-remove"></i>删除</a></li>'+
                            '</ul>'+
                            '</li>'+
                            '</ul>';
                    return html;

                }
            }
        ], {
            bAutoWidth:false,
            searching: true,
            bLengthChange: false,
            bSort: false,
            url: '${base}/pl/platform/listContexts',
            pageLength: 25

        });
    });
</script>

</@t.plat_body>
